<!DOCTYPE html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<!-- modify by zhangwei -->
<!-- 百度站长 -->
<meta name="baidu-site-verification" content="MdPKZBgY0U">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">



  <meta name="google-site-verification" content="8DKRuNxJDPU2k6cNyVhLe_eSqGk-R8oiYk8iKMg5gwI">














  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/uploads/favicon.ico?v=5.1.4">


  <link rel="mask-icon" href="/uploads/favicon.ico?v=5.1.4" color="#222">





  <meta name="keywords" content="Android,混淆,反编译,加壳,">





  <link rel="alternate" href="/atom.xml" title="班德尔城" type="application/atom+xml">






<meta name="description" content="反编译并不是为了去破解人家辛辛苦苦开发的app；混淆与加壳也是为了在一定程度上保护自己的开发成果。反编译、混淆、加壳是非常有用的技能。">
<meta name="keywords" content="Android,混淆,反编译,加壳">
<meta property="og:type" content="article">
<meta property="og:title" content="Android功守道-反编译VS混淆与加壳">
<meta property="og:url" content="https://tiimor.cn/Android功守道-反编译VS混淆与加壳/index.html">
<meta property="og:site_name" content="班德尔城">
<meta property="og:description" content="反编译并不是为了去破解人家辛辛苦苦开发的app；混淆与加壳也是为了在一定程度上保护自己的开发成果。反编译、混淆、加壳是非常有用的技能。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://cdn.tiimor.cn/images/%E5%94%AF%E7%BE%8E%E7%AF%87%EF%BC%8D%E8%97%8F%E5%9C%A8%E5%A2%99%E4%B8%AD%E7%9A%84android.jpg">
<meta property="og:image" content="http://cdn.tiimor.cn/images/%E6%9C%AA%E6%B7%B7%E6%B7%86.png">
<meta property="og:image" content="http://cdn.tiimor.cn/images/%E6%B7%B7%E6%B7%86.png">
<meta property="og:updated_time" content="2019-03-17T06:47:42.361Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Android功守道-反编译VS混淆与加壳">
<meta name="twitter:description" content="反编译并不是为了去破解人家辛辛苦苦开发的app；混淆与加壳也是为了在一定程度上保护自己的开发成果。反编译、混淆、加壳是非常有用的技能。">
<meta name="twitter:image" content="http://cdn.tiimor.cn/images/%E5%94%AF%E7%BE%8E%E7%AF%87%EF%BC%8D%E8%97%8F%E5%9C%A8%E5%A2%99%E4%B8%AD%E7%9A%84android.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '3AUIZWGETM',
      apiKey: '5fcd6d51d892fffe3480c5b37f5fd4fa',
      indexName: 'Tiimor',
      hits: {"per_page":8},
      labels: {"input_placeholder":"搜索","hits_empty":"未发现与「${query}」相关的内容","hits_stats":"${hits} 条相关条目，使用了 ${time} 毫秒"}
    }
  };
</script>



  <link rel="canonical" href="https://tiimor.cn/Android功守道-反编译VS混淆与加壳/">





  <title>Android功守道-反编译VS混淆与加壳 | 班德尔城</title>
  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-96457043-1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?abb97f8f68c9e5eb2217d3111c64e696";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

  <!-- modify by zhangwei -->
  <!-- 下雪的动画 -->
  <div class="canvas-snow">
    <canvas id="canvas" style="margin: 0;  padding: 0;top:0; left: 0; right: 0; background: transparent; position: absolute;" width="1366" height="105"></canvas>
      <script>

      var canvasBgImg = {
        start: function () {
          this.canvas = document.getElementById('canvas')
          this.ctx = this.canvas.getContext("2d")
          this.canvas.width = window.innerWidth
          this.canvas.height = 105
          this.starList = []
        },
        drawLine: function (ctx, x1, y1, x2, y2) {
          ctx.beginPath()
          ctx.strokeStyle = '#ffffff'
          ctx.lineTo(x1, y1)
          ctx.lineTo(x2, y2)
          ctx.stroke()
        },
        canvasSingleSnow: function (snowSize) {
          var singleSnow = document.createElement('canvas'),
            ctxSingle = singleSnow.getContext('2d')
          singleSnow.setAttribute('width', snowSize * 2)
          singleSnow.setAttribute('height', snowSize * 2)
          for (var i = 0; i < 6; i++) {
            ctxSingle.save()
            ctxSingle.translate(snowSize, snowSize)
            ctxSingle.rotate(Math.PI * 2 * i / 6)
            this.drawLine(ctxSingle, 0, 0, snowSize, 0)
            ctxSingle.restore()
          }
          return singleSnow
        },
        canvasAllSnow: function (centerSnow) {
          var canvasSnow = document.createElement('canvas'),
            ctxSnow = canvasSnow.getContext('2d'),
            bigSnow = this.canvasSingleSnow(centerSnow),
            smallSnow = this.canvasSingleSnow(centerSnow / 3),
            sizeSnow = centerSnow * 3 / 5,
            rSnow = centerSnow - sizeSnow / 2
          canvasSnow.setAttribute('width', centerSnow * 2)
          canvasSnow.setAttribute('height', centerSnow * 2)
          ctxSnow.drawImage(bigSnow, 0, 0, bigSnow.width, bigSnow.height, 0, 0, centerSnow * 2, centerSnow * 2)
          for (var i = 0; i < 6; i++) {
            ctxSnow.save()
            ctxSnow.translate(centerSnow, centerSnow)
            ctxSnow.rotate(Math.PI * 2 * i / 6)
            ctxSnow.drawImage(smallSnow, 0, 0, smallSnow.width, smallSnow.height, rSnow - sizeSnow / 2,
              -sizeSnow / 2, sizeSnow, sizeSnow)
            ctxSnow.restore()
          }
          return canvasSnow
        },
        init: function () {
          this.start()
          for (var i = 0; i < 75; i++) {
            this.starList.push({
              drawFunc: this.canvasAllSnow(15),
              width: Math.random() * this.canvas.width,
              height: Math.random() * this.canvas.height,
              speed: Math.random() * 1.5 + .5,
              scale: Math.random() * 12 + 5,
              angel: 0
            })
          }
          var self = this,
            loop = function () {
              self.ctx.clearRect(0, 0, self.canvas.width, self.canvas.width)
              for (var i = 0; i < 75; i++) {
                self.ctx.save()
                self.starList[i].height = self.starList[i].height + self.starList[i].speed
                self.starList[i].angel += 2
                self.ctx.translate(self.starList[i].width, self.starList[i].height)
                self.ctx.rotate(self.starList[i].angel * Math.PI / 360)
                self.ctx.translate(-self.starList[i].width, -self.starList[i].height)
                self.ctx.drawImage(self.starList[i].drawFunc, 0, 0,
                  self.starList[i].drawFunc.width, self.starList[i].drawFunc.height,
                  self.starList[i].width - self.starList[i].scale / 2,
                  self.starList[i].height - self.starList[i].scale / 2,
                  self.starList[i].scale, self.starList[i].scale)
                if (self.starList[i].height > self.canvas.height) {
                  self.starList[i] = Object.assign(self.starList[i], {
                    height: -self.starList[i].scale,
                    width: Math.random() * this.canvas.width
                  })
                }
                self.ctx.restore()
              }
              requestAnimationFrame(loop)
            }
          requestAnimationFrame(loop)
        }
      }
      canvasBgImg.init()
      </script>

    </div>


    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <!-- modify by zhangwei -->
        <!-- 圣诞帽 -->
        <img src="/uploads/santa-hat.png" id="santa" style="height: 41px; position: absolute; left: -40px; top: -20px; transform: rotate(-45deg); z-index: 9000;">

        <span class="logo-line-before"><i></i></span>
        <span class="site-title">班德尔城</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">微笑，简单，奋发</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-guestbook">
          <a href="/guestbook" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-send"></i> <br>
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-favourite">
          <a href="/favourite" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-bookmark"></i> <br>
            
            收藏
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br>
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  
  <div class="algolia-popup popup search-popup">
    <div class="algolia-search">
      <div class="algolia-search-input-icon">
        <i class="fa fa-search"></i>
      </div>
      <div class="algolia-search-input" id="algolia-search-input"></div>
    </div>

    <div class="algolia-results">
      <div id="algolia-stats"></div>
      <div id="algolia-hits"></div>
      <div id="algolia-pagination" class="algolia-pagination"></div>
    </div>

    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
  </div>




    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://tiimor.cn/Android功守道-反编译VS混淆与加壳/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Tiimor">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/uploads/avatar.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="班德尔城">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Android功守道-反编译VS混淆与加壳</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-12-19T20:18:41+08:00">
                2017-12-19
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Android联盟/" itemprop="url" rel="index">
                    <span itemprop="name">Android联盟</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a href="/Android功守道-反编译VS混淆与加壳/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count gitment-comments-count" data-xid="/Android功守道-反编译VS混淆与加壳/" itemprop="commentsCount"></span>
                </a>
              </span>
            
          

          
          
             <span id="/Android功守道-反编译VS混淆与加壳/" class="leancloud_visitors" data-flag-title="Android功守道-反编译VS混淆与加壳">
               <span class="post-meta-divider">|</span>
               <!-- modify by zhangwei -->
               <!-- 去掉阅读的眼睛图标，阅读次数改为℃ -->
			   
                 <span class="post-meta-item-text">热度 </span>
               
                 <span class="leancloud-visitors-count"></span>
				 <span>℃</span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><img src="http://cdn.tiimor.cn/images/%E5%94%AF%E7%BE%8E%E7%AF%87%EF%BC%8D%E8%97%8F%E5%9C%A8%E5%A2%99%E4%B8%AD%E7%9A%84android.jpg" alt="Android" title="&#x85CF;&#x5728;&#x5899;&#x4E2D;&#x7684;android"></p>
<p><strong>&#x53CD;&#x7F16;&#x8BD1;&#x5E76;&#x4E0D;&#x662F;&#x4E3A;&#x4E86;&#x53BB;&#x7834;&#x89E3;&#x4EBA;&#x5BB6;&#x8F9B;&#x8F9B;&#x82E6;&#x82E6;&#x5F00;&#x53D1;&#x7684;app&#xFF1B;&#x6DF7;&#x6DC6;&#x4E0E;&#x52A0;&#x58F3;&#x4E5F;&#x662F;&#x4E3A;&#x4E86;&#x5728;&#x4E00;&#x5B9A;&#x7A0B;&#x5EA6;&#x4E0A;&#x4FDD;&#x62A4;&#x81EA;&#x5DF1;&#x7684;&#x5F00;&#x53D1;&#x6210;&#x679C;&#x3002;&#x53CD;&#x7F16;&#x8BD1;&#x3001;&#x6DF7;&#x6DC6;&#x3001;&#x52A0;&#x58F3;&#x662F;&#x975E;&#x5E38;&#x6709;&#x7528;&#x7684;&#x6280;&#x80FD;&#x3002;</strong></p>
<a id="more"></a>
<p>&#x8BB0;&#x5F55;&#x4E00;&#x4E0B;&#x4E2A;&#x4EBA;&#x65E5;&#x5E38;&#x4F7F;&#x7528;</p>
<h1 id="&#x53CD;&#x7F16;&#x8BD1;"><a href="#&#x53CD;&#x7F16;&#x8BD1;" class="headerlink" title="&#x53CD;&#x7F16;&#x8BD1;"></a>&#x53CD;&#x7F16;&#x8BD1;</h1><h2 id="&#x53CD;&#x7F16;&#x8BD1;&#x5DE5;&#x5177;"><a href="#&#x53CD;&#x7F16;&#x8BD1;&#x5DE5;&#x5177;" class="headerlink" title="&#x53CD;&#x7F16;&#x8BD1;&#x5DE5;&#x5177;"></a>&#x53CD;&#x7F16;&#x8BD1;&#x5DE5;&#x5177;</h2><ul>
<li><p><strong><a href="http://note.youdao.com/noteshare?id=4407e5ea540038d4dd16e05b22ca89bb&amp;sub=4C55C31576284FEA8373E50938A16608" target="_blank" rel="noopener">apktool</a></strong><br>&#x8D44;&#x6E90;&#x6587;&#x4EF6;&#x83B7;&#x53D6;&#xFF0C;&#x53EF;&#x4EE5;&#x63D0;&#x53D6;&#x51FA;&#x56FE;&#x7247;&#x6587;&#x4EF6;&#x548C;&#x5E03;&#x5C40;&#x6587;&#x4EF6;&#x8FDB;&#x884C;&#x4F7F;&#x7528;&#x67E5;&#x770B;&#xFF1A;<code>apktool.bat d -f [apk&#x6587;&#x4EF6;] [&#x8F93;&#x51FA;&#x6587;&#x4EF6;&#x5939;]</code></p>
</li>
<li><p><strong><a href="http://note.youdao.com/noteshare?id=5bc5444d04b4c162b78c80ca6b503acf&amp;sub=6E2DCBD46DD44889980AA4FF7C3700F7" target="_blank" rel="noopener">dex2jar</a></strong><br>&#x5C06;apk&#x53CD;&#x7F16;&#x8BD1;&#x6210;Java&#x6E90;&#x7801;&#xFF08;classes.dex&#x8F6C;&#x5316;&#x6210;jar&#x6587;&#x4EF6;&#xFF09;&#xFF1A;<code>dex2jar.bat [apk&#x6587;&#x4EF6;]</code></p>
</li>
<li><p><strong><a href="http://note.youdao.com/noteshare?id=2564f7947bbba25c2541d2eccf4a2d10&amp;sub=1055626537D747098912D757314E9FB9" target="_blank" rel="noopener">jd-gui</a></strong><br>&#x67E5;&#x770B;APK&#x4E2D;classes.dex&#x8F6C;&#x5316;&#x6210;&#x51FA;&#x7684;jar&#x6587;&#x4EF6;&#xFF0C;&#x5373;&#x6E90;&#x7801;&#x6587;&#x4EF6;&#xFF1A;&#x7528;jd-gui.exe&#x6253;&#x5F00;&#x4E0A;&#x9762;&#x751F;&#x6210;&#x7684;classes.dex&#x5373;&#x53EF;</p>
</li>
</ul>
<p>&#x6CE8;&#xFF1A;<strong>AndroidKiller</strong>&#x662F;&#x4E00;&#x4E2A;&#x53CD;&#x7F16;&#x8BD1;&#x5DE5;&#x5177;&#xFF0C;&#x4E00;&#x6B65;&#x5230;&#x4F4D;&#xFF0C;&#x770B;Java&#x6E90;&#x7801;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x9700;&#x8981;&#x501F;&#x52A9;smail&#x8F6C;java&#x7684;&#x5DE5;&#x5177;&#x3002;&#x53E6;&#x5916;&#x5C06;test.apk&#x7684;apk&#x6587;&#x4EF6;&#x66F4;&#x6362;&#x540E;&#x7F00;&#x540D;&#x4E3A;test.zip&#xFF0C;&#x53EF;&#x4EE5;&#x63D0;&#x53D6;&#x51FA;&#x8D44;&#x6E90;&#x56FE;&#x7247;&#x6587;&#x4EF6;&#x7B49;&#x7B49;&#x3002;</p>
<h2 id="&#x672A;&#x6DF7;&#x6DC6;"><a href="#&#x672A;&#x6DF7;&#x6DC6;" class="headerlink" title="&#x672A;&#x6DF7;&#x6DC6;"></a>&#x672A;&#x6DF7;&#x6DC6;</h2><p>&#x672A;&#x6DF7;&#x6DC6;&#x7684;app&#xFF0C;&#x53CD;&#x7F16;&#x8BD1;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x6E90;&#x7801;&#xFF1A;<br><img src="http://cdn.tiimor.cn/images/%E6%9C%AA%E6%B7%B7%E6%B7%86.png" alt="&#x672A;&#x6DF7;&#x6DC6;"></p>
<h2 id="&#x6DF7;&#x6DC6;"><a href="#&#x6DF7;&#x6DC6;" class="headerlink" title="&#x6DF7;&#x6DC6;"></a>&#x6DF7;&#x6DC6;</h2><p>&#x6DF7;&#x6DC6;app&#x4E4B;&#x540E;&#xFF0C;&#x53CD;&#x7F16;&#x8BD1;&#x5F97;&#x5230;&#x7684;&#x6E90;&#x7801;&#xFF1A;<br><img src="http://cdn.tiimor.cn/images/%E6%B7%B7%E6%B7%86.png" alt="&#x6DF7;&#x6DC6;"></p>
<h1 id="&#x6DF7;&#x6DC6;-1"><a href="#&#x6DF7;&#x6DC6;-1" class="headerlink" title="&#x6DF7;&#x6DC6;"></a>&#x6DF7;&#x6DC6;</h1><p>&#x5F00;&#x542F;App&#x7684;&#x6DF7;&#x6DC6;&#xFF0C;&#x5728;&#x4E00;&#x5B9A;&#x7A0B;&#x5EA6;&#x4E0A;&#x4FDD;&#x62A4;&#x81EA;&#x5DF1;&#x8F9B;&#x82E6;&#x5F00;&#x53D1;&#x7684;&#x6210;&#x679C;&#xFF0C;&#x5373;&#x53CD;&#x7F16;&#x8BD1;&#x51FA;&#x6765;&#x7684;&#x6E90;&#x7801;&#x662F;<code>a b c...</code>&#x8FD9;&#x6837;&#x7684;&#xFF0C;&#x4F46;&#x662F;&#x4ECD;&#x7136;&#x53EF;&#x4EE5;&#x88AB;&#x53CD;&#x7F16;&#x8BD1;&#x770B;&#x5230;AndroidManifest&#x548C;&#x8D44;&#x6E90;&#x6587;&#x4EF6;&#x3002;</p>
<h2 id="&#x5F00;&#x542F;&#x6DF7;&#x6DC6;"><a href="#&#x5F00;&#x542F;&#x6DF7;&#x6DC6;" class="headerlink" title="&#x5F00;&#x542F;&#x6DF7;&#x6DC6;"></a>&#x5F00;&#x542F;&#x6DF7;&#x6DC6;</h2><p>&#x5728;Android Studio&#x7684;app&#x5DE5;&#x7A0B;&#x76EE;&#x5F55;&#x91CC;&#xFF0C;release&#x7248;&#x672C;&#x5F00;&#x542F;&#x4EE3;&#x7801;&#x6DF7;&#x6DC6;&#xFF0C;&#x7136;&#x540E;&#x6DF7;&#x6DC6;&#x7684;&#x914D;&#x7F6E;&#x5199;&#x5728;&#x8BE5;&#x76EE;&#x5F55;&#x91CC;&#x7684;<code>proguard-rules.pro</code>&#x6587;&#x4EF6;&#x91CC;</p>
<figure class="highlight actionscript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">release {</span><br><span class="line">    <span class="comment">// proguard files</span></span><br><span class="line">    minifyEnabled <span class="literal">true</span></span><br><span class="line"></span><br><span class="line">    <span class="comment">// add proguard cfg</span></span><br><span class="line">    proguardFiles getDefaultProguardFile(<span class="string">&apos;proguard-android-optimize.txt&apos;</span>), <span class="string">&apos;proguard-rules.pro&apos;</span></span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
<h2 id="&#x914D;&#x7F6E;proguard-rules"><a href="#&#x914D;&#x7F6E;proguard-rules" class="headerlink" title="&#x914D;&#x7F6E;proguard-rules"></a>&#x914D;&#x7F6E;proguard-rules</h2><p>&#x914D;&#x7F6E;&#x8BE5;&#x6587;&#x4EF6;&#x662F;&#x4E3A;&#x4E86;&#x9632;&#x6B62;&#x67D0;&#x4E9B;&#x529F;&#x80FD;&#x7684;&#x6B63;&#x5E38;&#x4F7F;&#x7528;&#xFF0C;&#x4EE3;&#x7801;&#x8FC7;&#x4E8E;&#x6DF7;&#x6DC6;&#xFF0C;&#x4F1A;&#x5BFC;&#x81F4;&#x529F;&#x80FD;&#x65E0;&#x6CD5;&#x4F7F;&#x7528;&#xFF0C;&#x8FD9;&#x4E2A;&#x65F6;&#x5019;&#x5C31;&#x8981;&#x4FDD;&#x6301;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;&#x3002;&#x6BD4;&#x8F83;&#x5168;&#x9762;&#x7684;&#x901A;&#x7528;&#x914D;&#x7F6E;&#xFF08;&#x5E38;&#x7528;&#x7684;&#x7B2C;&#x4E09;&#x65B9;&#x6846;&#x67B6;&#xFF09;&#x5982;&#x4E0B;&#xFF1A;</p>
<figure class="highlight crystal"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Add project specific ProGuard rules here.</span></span><br><span class="line"><span class="comment"># By default, the flags in this file are appended to flags specified</span></span><br><span class="line"><span class="comment"># in E:\AndroidTools\AndroidStudio\sdk/tools/proguard/proguard-android.txt</span></span><br><span class="line"><span class="comment"># You can edit the include path and order by changing the proguardFiles</span></span><br><span class="line"><span class="comment"># directive in build.gradle.</span></span><br><span class="line"><span class="comment">#</span></span><br><span class="line"><span class="comment"># For more details, see</span></span><br><span class="line"><span class="comment">#   http://developer.android.com/guide/developing/tools/proguard.html</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Add any project specific keep options here:</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x6307;&#x5B9A;&#x4EE3;&#x7801;&#x7684;&#x538B;&#x7F29;&#x7EA7;&#x522B;------------</span></span><br><span class="line">-optimizationpasses <span class="number">5</span></span><br><span class="line"><span class="comment">###-----------&#x662F;&#x5426;&#x4F7F;&#x7528;&#x5927;&#x5C0F;&#x5199;&#x6DF7;&#x5408;------------</span></span><br><span class="line">-dontusemixedcaseclassnames</span><br><span class="line"><span class="comment">###-----------&#x6DF7;&#x6DC6;&#x65F6;&#x662F;&#x5426;&#x505A;&#x9884;&#x6821;&#x9A8C;------------</span></span><br><span class="line">-dontpreverify</span><br><span class="line"><span class="comment">###-----------&#x6DF7;&#x6DC6;&#x65F6;&#x662F;&#x5426;&#x8BB0;&#x5F55;&#x65E5;&#x5FD7;------------</span></span><br><span class="line">-verbose</span><br><span class="line"><span class="comment">###-----------&#x5FFD;&#x7565;&#x8B66;&#x544A;------------</span></span><br><span class="line">-ignorewarnings</span><br><span class="line">-keepattributes EnclosingMethod</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x8BC1;&#x5F02;&#x5E38;&#x65F6;&#x663E;&#x793A;&#x884C;&#x53F7;------------</span></span><br><span class="line">-renamesourcefileattribute SourceFile</span><br><span class="line">-keepattributes SourceFile,LineNumberTable</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x6CE8;&#x89E3;------------</span></span><br><span class="line">-keepattributes *Annotation*</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x6CDB;&#x578B;------------</span></span><br><span class="line">-keepattributes Signature</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x5F02;&#x5E38;------------</span></span><br><span class="line">-keepattributes Exceptions</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x53BB;&#x6389;&#x4EE3;&#x7801;&#x91CC;&#x7684;Log------------</span></span><br><span class="line">-assumenosideeffects <span class="class"><span class="keyword">class</span> <span class="title">android</span>.<span class="title">util</span>.<span class="title">Log</span> {</span></span><br><span class="line">    public static boolean isLoggable(java.lang.String,int);</span><br><span class="line">    public static *** d(...);</span><br><span class="line">	public static *** v(...);</span><br><span class="line">	public static *** i(...);</span><br><span class="line">	public static *** w(...);</span><br><span class="line">	public static *** e(...);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x6DF7;&#x6DC6;&#x65F6;&#x6240;&#x91C7;&#x7528;&#x7684;&#x7B97;&#x6CD5;------------</span></span><br><span class="line">-optimizations !code/simplification/arithmetic,!field/*,!<span class="class"><span class="keyword">class</span>/<span class="title">merging</span>/*</span></span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;Activity&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">app</span>.<span class="title">Activity</span></span></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;AppCompatActivity&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">support</span>.<span class="title">v7</span>.<span class="title">app</span>.<span class="title">AppCompatActivity</span></span></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;DialogFragment&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">app</span>.<span class="title">DialogFragment</span></span></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;Application&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">app</span>.<span class="title">Application</span></span></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;Service&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">app</span>.<span class="title">Service</span></span></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;BroadcastReceiver&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">content</span>.<span class="title">BroadcastReceiver</span></span></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;ContentProvider&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">content</span>.<span class="title">ContentProvider</span></span></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;BackupAgentHelper&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">app</span>.<span class="title">backup</span>.<span class="title">BackupAgentHelper</span></span></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;Preference&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">preference</span>.<span class="title">Preference</span></span></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;ILicensingService&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">android</span>.<span class="title">vending</span>.<span class="title">licensing</span>.<span class="title">ILicensingService</span></span></span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; native &#x65B9;&#x6CD5;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keepclasseswithmembernames <span class="class"><span class="keyword">class</span> * {</span></span><br><span class="line">    native &lt;methods&gt;;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;&#x81EA;&#x5B9A;&#x4E49;&#x63A7;&#x4EF6;&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keepclasseswithmembers <span class="class"><span class="keyword">class</span> * {</span></span><br><span class="line">    public &lt;init&gt;(android.content.Context, android.util.AttributeSet);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;&#x81EA;&#x5B9A;&#x4E49;&#x63A7;&#x4EF6;&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keepclasseswithmembers <span class="class"><span class="keyword">class</span> * {</span></span><br><span class="line">    public &lt;init&gt;(android.content.Context, android.util.AttributeSet, int);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;&#x81EA;&#x5B9A;&#x4E49;&#x63A7;&#x4EF6;&#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keepclassmembers <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">android</span>.<span class="title">app</span>.<span class="title">Activity</span> {</span></span><br><span class="line">    public void *(android.view.View);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301;&#x679A;&#x4E3E; enum &#x7C7B;&#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keepclassmembers <span class="class"><span class="keyword">enum</span> * {</span></span><br><span class="line">    public static **[] values();</span><br><span class="line">    public static ** valueOf(java.lang.String);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------# &#x4FDD;&#x6301; Parcelable &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> * <span class="title">implements</span> <span class="title">android</span>.<span class="title">os</span>.<span class="title">Parcelable</span> {</span></span><br><span class="line">    public static final android.os.Parcelable$Creator *;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; retrofit &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-dontwarn retrofit2.**</span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> <span class="title">retrofit2</span>.** { *;</span> }</span><br><span class="line">-dontwarn javax.<span class="keyword">annotation</span>.**</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; okhttp &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-dontwarn com.squareup.okhttp3.**</span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">squareup</span>.<span class="title">okhttp3</span>.** { *;</span>}</span><br><span class="line">-dontwarn okio.**</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; GreenDao &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keepclassmembers <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">org</span>.<span class="title">greenrobot</span>.<span class="title">greendao</span>.<span class="title">AbstractDao</span> {</span></span><br><span class="line">public static java.lang.String TABLENAME;</span><br><span class="line">}</span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> **$<span class="title">Properties</span></span></span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; Zbar &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> <span class="title">net</span>.<span class="title">sourceforge</span>.<span class="title">zbar</span>.** { *;</span> }</span><br><span class="line">-keep interface net.sourceforge.zbar.** { *; }</span><br><span class="line">-dontwarn net.sourceforge.zbar.**</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; Glide &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">implements</span> <span class="title">com</span>.<span class="title">bumptech</span>.<span class="title">glide</span>.<span class="title">module</span>.<span class="title">GlideModule</span></span></span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">com</span>.<span class="title">bumptech</span>.<span class="title">glide</span>.<span class="title">module</span>.<span class="title">AppGlideModule</span></span></span><br><span class="line">-keep public <span class="class"><span class="keyword">enum</span> <span class="title">com</span>.<span class="title">bumptech</span>.<span class="title">glide</span>.<span class="title">load</span>.<span class="title">resource</span>.<span class="title">bitmap</span>.<span class="title">ImageHeaderParser</span>$** {</span></span><br><span class="line">  **[] $VALUES;</span><br><span class="line">  public *;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; eventbus &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keepattributes *Annotation*</span><br><span class="line">-keepclassmembers <span class="class"><span class="keyword">class</span> ** {</span></span><br><span class="line">    @org.greenrobot.eventbus.Subscribe &lt;methods&gt;;</span><br><span class="line">}</span><br><span class="line">-keep <span class="class"><span class="keyword">enum</span> <span class="title">org</span>.<span class="title">greenrobot</span>.<span class="title">eventbus</span>.<span class="title">ThreadMode</span> { *;</span> }</span><br><span class="line"><span class="comment"># Only required if you use AsyncExecutor</span></span><br><span class="line">-keepclassmembers <span class="class"><span class="keyword">class</span> * <span class="title">extends</span> <span class="title">org</span>.<span class="title">greenrobot</span>.<span class="title">eventbus</span>.<span class="title">util</span>.<span class="title">ThrowableFailureEvent</span> {</span></span><br><span class="line">    &lt;init&gt;(java.lang.Throwable);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; MPAndroidChart &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">github</span>.<span class="title">mikephil</span>.<span class="title">charting</span>.** { *;</span> }</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; bugly &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-dontwarn com.tencent.bugly.**</span><br><span class="line">-keep public <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">tencent</span>.<span class="title">bugly</span>.**{*;</span>}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; gson &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> <span class="title">sun</span>.<span class="title">misc</span>.<span class="title">Unsafe</span> { *;</span> }</span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">google</span>.<span class="title">gson</span>.<span class="title">stream</span>.** { *;</span> }</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; Rxjava RxAndroid &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-dontwarn sun.misc.**</span><br><span class="line">-keepclassmembers <span class="class"><span class="keyword">class</span> <span class="title">rx</span>.<span class="title">internal</span>.<span class="title">util</span>.<span class="title">unsafe</span>.*<span class="title">ArrayQueue</span>*<span class="title">Field</span>* {</span></span><br><span class="line">   long producerIndex;</span><br><span class="line">   long consumerIndex;</span><br><span class="line">}</span><br><span class="line">-keepclassmembers <span class="class"><span class="keyword">class</span> <span class="title">rx</span>.<span class="title">internal</span>.<span class="title">util</span>.<span class="title">unsafe</span>.<span class="title">BaseLinkedQueueProducerNodeRef</span> {</span></span><br><span class="line">    rx.internal.util.atomic.LinkedQueueNode producerNode;</span><br><span class="line">}</span><br><span class="line">-keepclassmembers <span class="class"><span class="keyword">class</span> <span class="title">rx</span>.<span class="title">internal</span>.<span class="title">util</span>.<span class="title">unsafe</span>.<span class="title">BaseLinkedQueueConsumerNodeRef</span> {</span></span><br><span class="line">    rx.internal.util.atomic.LinkedQueueNode consumerNode;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; volley &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">android</span>.<span class="title">volley</span>.** { *;</span> }</span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">android</span>.<span class="title">volley</span>.<span class="title">toolbox</span>.** { *;</span> }</span><br><span class="line"></span><br><span class="line"><span class="comment">###-----------&#x4FDD;&#x6301; &#x672C;&#x9879;&#x76EE;&#x7684;gson&#x5B9E;&#x4F53;&#x7C7B; &#x4E0D;&#x88AB;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line"><span class="comment">###-----------&#x7F51;&#x7EDC;&#x8BF7;&#x6C42;&#x89E3;&#x6790;&#x7684;&#x5B9E;&#x4F53;&#x7C7B;&#x4E00;&#x5B9A;&#x4E0D;&#x8981;&#x6DF7;&#x6DC6;------------</span></span><br><span class="line">-keep <span class="class"><span class="keyword">class</span> <span class="title">your</span>-<span class="title">package</span>.<span class="title">entity</span>.** { *;</span> }</span><br><span class="line"></span><br><span class="line"><span class="comment"># If your project uses WebView with JS, uncomment the following</span></span><br><span class="line"><span class="comment"># and specify the fully qualified class name to the JavaScript interface</span></span><br><span class="line"><span class="comment"># class:</span></span><br><span class="line"><span class="comment">#-keepclassmembers class fqcn.of.javascript.interface.for.webview {</span></span><br><span class="line"><span class="comment">#   public *;</span></span><br><span class="line"><span class="comment">#}</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Uncomment this to preserve the line number information for</span></span><br><span class="line"><span class="comment"># debugging stack traces.</span></span><br><span class="line"><span class="comment">#-keepattributes SourceFile,LineNumberTable</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># If you keep the line number information, uncomment this to</span></span><br><span class="line"><span class="comment"># hide the original source file name.</span></span><br><span class="line"><span class="comment">#-renamesourcefileattribute SourceFile</span></span><br></pre></td></tr></tbody></table></figure>
<h2 id="Proguard&#x5E38;&#x7528;&#x8BED;&#x6CD5;"><a href="#Proguard&#x5E38;&#x7528;&#x8BED;&#x6CD5;" class="headerlink" title="Proguard&#x5E38;&#x7528;&#x8BED;&#x6CD5;"></a><a href="http://www.trinea.cn/android/proguard-grammar/" target="_blank" rel="noopener">Proguard&#x5E38;&#x7528;&#x8BED;&#x6CD5;</a></h2><ul>
<li>&#x5173;&#x952E;&#x5B57;</li>
</ul>
<table>
<thead>
<tr>
<th>&#x5173;&#x952E;&#x5B57;</th>
<th>&#x63CF;&#x8FF0;</th>
</tr>
</thead>
<tbody>
<tr>
<td>keep</td>
<td>&#x4FDD;&#x7559;&#x7C7B;&#x548C;&#x7C7B;&#x4E2D;&#x7684;&#x6210;&#x5458;&#xFF0C;&#x9632;&#x6B62;&#x5B83;&#x4EEC;&#x88AB;&#x79FB;&#x9664;&#x6216;&#x88AB;&#x91CD;&#x547D;&#x540D;</td>
</tr>
<tr>
<td>keepnames</td>
<td>&#x4FDD;&#x7559;&#x7C7B;&#x548C;&#x7C7B;&#x4E2D;&#x7684;&#x6210;&#x5458;&#xFF0C;&#x9632;&#x6B62;&#x5B83;&#x4EEC;&#x88AB;&#x91CD;&#x547D;&#x540D;&#xFF0C;&#x4F46;&#x5F53;&#x6210;&#x5458;&#x6CA1;&#x6709;&#x88AB;&#x5F15;&#x7528;&#x65F6;&#x4F1A;&#x88AB;&#x79FB;&#x9664;</td>
</tr>
<tr>
<td>keepclassmembers</td>
<td>&#x53EA;&#x4FDD;&#x7559;&#x7C7B;&#x4E2D;&#x7684;&#x6210;&#x5458;&#xFF0C;&#x9632;&#x6B62;&#x5B83;&#x4EEC;&#x88AB;&#x79FB;&#x9664;&#x6216;&#x8005;&#x88AB;&#x91CD;&#x547D;&#x540D;</td>
</tr>
<tr>
<td>keepclassmembernames</td>
<td>&#x53EA;&#x4FDD;&#x7559;&#x7C7B;&#x4E2D;&#x7684;&#x6210;&#x5458;&#xFF0C;&#x9632;&#x6B62;&#x5B83;&#x4EEC;&#x88AB;&#x91CD;&#x547D;&#x540D;&#xFF0C;&#x4F46;&#x5F53;&#x6210;&#x5458;&#x6CA1;&#x6709;&#x88AB;&#x5F15;&#x7528;&#x65F6;&#x4F1A;&#x88AB;&#x79FB;&#x9664;</td>
</tr>
<tr>
<td>keepclasseswithmembers</td>
<td>&#x9632;&#x6B62;<strong>&#x62E5;&#x6709;&#x8BE5;&#x6210;&#x5458;&#x7684;</strong>&#x7C7B;&#x548C;&#x6210;&#x5458;&#x88AB;&#x79FB;&#x9664;&#x6216;&#x88AB;&#x91CD;&#x547D;&#x540D;&#xFF0C;&#x524D;&#x63D0;&#x662F;&#x6307;&#x660E;&#x7684;&#x7C7B;&#x4E2D;&#x7684;&#x6210;&#x5458;&#x5FC5;&#x987B;&#x5B58;&#x5728;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x5B58;&#x5728;&#x5219;&#x8FD8;&#x662F;&#x4F1A;&#x6DF7;&#x6DC6;</td>
</tr>
<tr>
<td>keepclasseswithmembernames</td>
<td>&#x9632;&#x6B62;<strong>&#x62E5;&#x6709;&#x8BE5;&#x6210;&#x5458;&#x7684;</strong>&#x7C7B;&#x548C;&#x6210;&#x5458;&#x88AB;&#x91CD;&#x547D;&#x540D;&#xFF0C;&#x4F46;&#x5F53;&#x6210;&#x5458;&#x6CA1;&#x6709;&#x88AB;&#x5F15;&#x7528;&#x65F6;&#x4F1A;&#x88AB;&#x79FB;&#x9664;&#xFF0C;&#x524D;&#x63D0;&#x662F;&#x6307;&#x660E;&#x7684;&#x7C7B;&#x4E2D;&#x7684;&#x6210;&#x5458;&#x5FC5;&#x987B;&#x5B58;&#x5728;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x5B58;&#x5728;&#x5219;&#x8FD8;&#x662F;&#x4F1A;&#x6DF7;&#x6DC6;</td>
</tr>
</tbody>
</table>
<ul>
<li>&#x901A;&#x914D;&#x7B26;</li>
</ul>
<table>
<thead>
<tr>
<th>&#x901A;&#x914D;&#x7B26;</th>
<th>&#x63CF;&#x8FF0;</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>&lt;field&gt;</code></td>
<td>&#x5339;&#x914D;&#x7C7B;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x5B57;&#x6BB5;</td>
</tr>
<tr>
<td><code>&lt;method&gt;</code></td>
<td>&#x5339;&#x914D;&#x7C7B;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x65B9;&#x6CD5;</td>
</tr>
<tr>
<td><code>&lt;init&gt;</code></td>
<td>&#x5339;&#x914D;&#x7C7B;&#x4E2D;&#x7684;&#x6240;&#x6709;&#x6784;&#x9020;&#x51FD;&#x6570;</td>
</tr>
<tr>
<td><code>*</code></td>
<td><code>&#x5339;&#x914D;&#x4EFB;&#x610F;&#x957F;&#x5EA6;&#x5B57;&#x7B26;&#xFF0C;&#x4F46;&#x4E0D;&#x542B;&#x5305;&#x540D;&#x5206;&#x9694;&#x7B26;&#xFF08;.&#xFF09;&#xFF1B;&#x5982;&#x5B8C;&#x6574;&#x5305;&#x540D;&#xFF1A;com.example.test.util&#xFF0C;&#x4F7F;&#x7528;com.*&#x3001;com.example.*&#x90FD;&#x662F;&#x65E0;&#x6CD5;&#x5339;&#x914D;&#x7684;&#xFF0C;&#x56E0;&#x4E3A;*&#x65E0;&#x6CD5;&#x5339;&#x914D;&#x5305;&#x540D;&#x4E2D;&#x7684;&#x5206;&#x9694;&#x7B26;&#xFF0C;&#x6B63;&#x786E;&#x7684;&#x5339;&#x914D;&#x65B9;&#x5F0F;&#x662F;com.example.*.*&#x3001;com.example.test.*&#xFF1B;&#x5982;&#x679C;&#x4F60;&#x4E0D;&#x5199;&#x4EFB;&#x4F55;&#x5176;&#x4ED6;&#x5185;&#x5BB9;&#xFF0C;&#x53EA;&#x6709;&#x4E00;&#x4E2A;*&#xFF0C;&#x5219;&#x8868;&#x793A;&#x5339;&#x914D;&#x6240;&#x6709;&#x7684;&#x5B57;&#x7B26;</code></td>
</tr>
<tr>
<td><code>**</code></td>
<td>&#x5339;&#x914D;&#x4EFB;&#x610F;&#x957F;&#x5EA6;&#x5B57;&#x7B26;&#xFF0C;&#x5E76;&#x4E14;&#x5305;&#x542B;&#x5305;&#x540D;&#x5206;&#x9694;&#x7B26;&#xFF08;.&#xFF09;&#xFF1B;&#x5982;&#x6DF7;&#x6DC6;&#x6587;&#x4EF6;&#x91CC;&#x7684;&#xFF1A;dontwarn android.support.**&#x5C31;&#x53EF;&#x4EE5;&#x5339;&#x914D;android.support&#x5305;&#x4E0B;&#x7684;&#x6240;&#x6709;&#x5185;&#x5BB9;&#xFF0C;&#x5305;&#x62EC;&#x4EFB;&#x610F;&#x957F;&#x5EA6;&#x7684;&#x5B50;&#x5305;</td>
</tr>
<tr>
<td><code>***</code></td>
<td>&#x5339;&#x914D;&#x4EFB;&#x610F;&#x53C2;&#x6570;&#x7C7B;&#x578B;&#xFF1B;&#x5982;<code>void set(***)</code>&#x5339;&#x914D;&#x4EFB;&#x610F;&#x4F20;&#x5165;&#x7684;&#x53C2;&#x6570;&#x7C7B;&#x578B;&#xFF0C;<code>*** get()</code>&#x5C31;&#x80FD;&#x5339;&#x914D;&#x4EFB;&#x610F;&#x8FD4;&#x56DE;&#x503C;&#x7684;&#x7C7B;&#x578B;</td>
</tr>
<tr>
<td><code>...</code></td>
<td>&#x5339;&#x914D;&#x4EFB;&#x610F;&#x957F;&#x5EA6;&#x7684;&#x4EFB;&#x610F;&#x7C7B;&#x578B;&#x53C2;&#x6570;&#xFF1B;&#x5982;void test(&#x2026;)&#x5339;&#x914D;<code>void test(String a)</code>&#x6216;<code>void test(int a, String b)</code>&#x7B49;&#x7B49;</td>
</tr>
</tbody>
</table>
<ul>
<li>&#x5E38;&#x89C1;&#x89C4;&#x5219;</li>
</ul>
<p>&#x5F62;&#x5982;&#xFF1A;<br></p><figure class="highlight markdown"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">[<span class="string">&#x5173;&#x952E;&#x5B57;</span>][<span class="symbol">&#x7C7B;</span>]{</span><br><span class="line"><span class="code">	[&#x6210;&#x5458;]</span></span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure><p></p>
<p>&#x5305;&#xFF1A;<code>com.example.test</code><br>&#x7C7B;&#xFF1A;A</p>
<ul>
<li><p>&#x4E0D;&#x6DF7;&#x6DC6;&#x67D0;&#x4E2A;&#x7C7B;</p>
<figure class="highlight actionscript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-keep <span class="keyword">public</span> <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">example</span>.<span class="title">test</span>.<span class="title">A</span> </span>{ *; }</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x4E0D;&#x6DF7;&#x6DC6;&#x67D0;&#x4E2A;&#x5305;&#x4E0B;&#x6240;&#x6709;&#x7684;&#x7C7B;</p>
<figure class="highlight haml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-<span class="ruby">keep <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">example</span>.<span class="title">test</span>.**{ *;</span> }</span></span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x4E0D;&#x6DF7;&#x6DC6;&#x67D0;&#x4E2A;&#x7C7B;&#x7684;&#x5B50;&#x7C7B;</p>
<figure class="highlight scala"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-keep public <span class="class"><span class="keyword">class</span> <span class="title">*</span> <span class="keyword">extends</span> <span class="title">com</span>.<span class="title">example</span>.<span class="title">test</span>.<span class="title">A</span> </span>{ *; }</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x4E0D;&#x6DF7;&#x6DC6;&#x6240;&#x6709;&#x7C7B;&#x540D;&#x4E2D;&#x5305;&#x542B;&#x4E86;&#x201D;&#x5173;&#x952E;&#x5B57;&#x201D;&#x7684;&#x7C7B;&#x53CA;&#x6210;&#x5458;</p>
<figure class="highlight actionscript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-keep <span class="keyword">public</span> <span class="class"><span class="keyword">class</span> **.*<span class="title">model</span>*.** </span>{ *; }</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x4E0D;&#x6DF7;&#x6DC6;&#x67D0;&#x4E2A;&#x63A5;&#x53E3;</p>
<figure class="highlight actionscript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-keep <span class="class"><span class="keyword">class</span> * <span class="keyword">implements</span> <span class="title">com</span>.<span class="title">example</span>.<span class="title">test</span>.<span class="title">Interface</span> </span>{ *; }</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x4E0D;&#x6DF7;&#x6DC6;&#x67D0;&#x4E2A;&#x7C7B;&#x7684;&#x6784;&#x9020;&#x65B9;&#x6CD5;</p>
<figure class="highlight kotlin"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">-keepclassmembers <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">example</span>.<span class="title">test</span>.<span class="title">A</span> </span>{</span><br><span class="line">	<span class="keyword">public</span> &lt;<span class="keyword">init</span>&gt;();</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x4E0D;&#x6DF7;&#x6DC6;&#x67D0;&#x4E2A;&#x7C7B;&#x7684;&#x7279;&#x5B9A;&#x7684;&#x65B9;&#x6CD5;</p>
<figure class="highlight cpp"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">-keepclassmembers <span class="class"><span class="keyword">class</span> <span class="title">com</span>.<span class="title">example</span>.<span class="title">test</span>.<span class="title">A</span> {</span></span><br><span class="line">	<span class="function"><span class="keyword">public</span> <span class="keyword">void</span> <span class="title">test</span><span class="params">(java.lang.String)</span></span>;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
<li><p>&#x4E0D;&#x6DF7;&#x6DC6;&#x67D0;&#x4E2A;&#x7C7B;&#x7684;&#x5185;&#x90E8;&#x7C7B;</p>
<figure class="highlight stata"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">-<span class="keyword">keep</span> <span class="keyword">class</span> com.example.<span class="keyword">test</span>.A$* {</span><br><span class="line"><span class="comment">	*;</span></span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure>
</li>
</ul>
<h2 id="&#x6DF7;&#x6DC6;&#x6CE8;&#x610F;"><a href="#&#x6DF7;&#x6DC6;&#x6CE8;&#x610F;" class="headerlink" title="&#x6DF7;&#x6DC6;&#x6CE8;&#x610F;"></a>&#x6DF7;&#x6DC6;&#x6CE8;&#x610F;</h2><p>&#x4EE3;&#x7801;&#x5F00;&#x542F;&#x6DF7;&#x6DC6;&#x4E4B;&#x540E;&#xFF0C;&#x8C03;&#x8BD5;app&#x6216;&#x8005;&#x9047;&#x5230;app&#x5F02;&#x5E38;&#x65F6;&#xFF0C;&#x6253;&#x5370;&#x91CC;&#x9762;&#x663E;&#x793A;&#x7684;&#x5219;&#x662F;<code>a b c...</code>&#x8FD9;&#x79CD;&#x7684;&#x5F02;&#x5E38;&#xFF0C;&#x5B9A;&#x4F4D;&#x4E0D;&#x5230;&#x5F02;&#x5E38;&#x7684;&#x4F4D;&#x7F6E;&#xFF0C;&#x8FD9;&#x4E2A;&#x65F6;&#x5019;&#x5728;&#x76EE;&#x5F55;<code>build\outputs\mapping\release</code>&#x91CC;&#xFF0C;&#x4F7F;&#x7528;mapping.txt&#xFF0C;&#x7ED3;&#x5408;SDK&#x91CC;&#x7684;&#x5DE5;&#x5177;<br><code>sdk\tools\proguard\bin\proguardgui.bat</code>-&gt;ReTrace&#xFF0C;&#x8FDB;&#x884C;&#x5B9A;&#x4F4D;&#x5F02;&#x5E38;&#xFF0C;&#x57FA;&#x672C;&#x4E0A;&#x53EF;&#x4EE5;&#x5B9A;&#x4F4D;&#xFF0C;&#x7136;&#x540E;&#x89E3;&#x51B3;&#x5F02;&#x5E38;&#x9519;&#x8BEF;&#x3002;</p>
<h1 id="&#x52A0;&#x58F3;"><a href="#&#x52A0;&#x58F3;" class="headerlink" title="&#x52A0;&#x58F3;"></a>&#x52A0;&#x58F3;</h1><p>&#x52A0;&#x58F3;&#x662F;&#x5728;&#x4E8C;&#x8FDB;&#x5236;&#x7684;&#x7A0B;&#x5E8F;&#x4E2D;&#x690D;&#x5165;&#x4E00;&#x6BB5;&#x4EE3;&#x7801;&#xFF0C;&#x5728;&#x8FD0;&#x884C;&#x7684;&#x65F6;&#x5019;&#x4F18;&#x5148;&#x53D6;&#x5F97;&#x7A0B;&#x5E8F;&#x7684;&#x63A7;&#x5236;&#x6743;&#xFF0C;&#x505A;&#x4E00;&#x4E9B;&#x989D;&#x5916;&#x7684;&#x5DE5;&#x4F5C;&#x3002;&#x662F;&#x5E94;&#x7528;&#x52A0;&#x56FA;&#x7684;&#x4E00;&#x79CD;&#x624B;&#x6CD5;&#x5BF9;&#x539F;&#x59CB;&#x4E8C;&#x8FDB;&#x5236;&#x539F;&#x6587;&#x8FDB;&#x884C;&#x52A0;&#x5BC6;/&#x9690;&#x85CF;/&#x6DF7;&#x6DC6;&#x3002;&#x52A0;&#x58F3;&#x7684;&#x7A0B;&#x5E8F;&#x53EF;&#x4EE5;&#x6709;&#x6548;&#x963B;&#x6B62;&#x5BF9;&#x7A0B;&#x5E8F;&#x7684;&#x53CD;&#x6C47;&#x7F16;&#x5206;&#x6790;&#xFF0C;&#x5E38;&#x7528;&#x6765;&#x4FDD;&#x62A4;&#x8F6F;&#x4EF6;&#x7248;&#x6743;&#xFF0C;&#x9632;&#x6B62;&#x88AB;&#x8F6F;&#x4EF6;&#x7834;&#x89E3;&#x3002;</p>
<h2 id="Android-Dex&#x6587;&#x4EF6;&#x52A0;&#x58F3;&#x539F;&#x7406;"><a href="#Android-Dex&#x6587;&#x4EF6;&#x52A0;&#x58F3;&#x539F;&#x7406;" class="headerlink" title="Android Dex&#x6587;&#x4EF6;&#x52A0;&#x58F3;&#x539F;&#x7406;"></a>Android Dex&#x6587;&#x4EF6;&#x52A0;&#x58F3;&#x539F;&#x7406;</h2><p>Android Dex&#x6587;&#x4EF6;&#x5927;&#x91CF;&#x4F7F;&#x7528;&#x5F15;&#x7528;&#x7ED9;&#x52A0;&#x58F3;&#x5E26;&#x6765;&#x4E86;&#x4E00;&#x5B9A;&#x7684;&#x96BE;&#x5EA6;&#xFF0C;&#x4F46;&#x662F;&#x4ECE;&#x7406;&#x8BBA;&#x4E0A;&#x8BB2;&#xFF0C;Android APK&#x52A0;&#x58F3;&#x4E5F;&#x662F;&#x53EF;&#x884C;&#x7684;&#x3002;</p>
<ul>
<li><p>&#x52A0;&#x58F3;&#x7A0B;&#x5E8F;&#xFF1A;&#x52A0;&#x5BC6;&#x6E90;&#x7A0B;&#x5E8F;&#x4E3A;&#x89E3;&#x58F3;&#x6570;&#x636E;&#x3001;&#x7EC4;&#x88C5;&#x89E3;&#x58F3;&#x7A0B;&#x5E8F;&#x548C;&#x89E3;&#x58F3;&#x6570;&#x636E;</p>
</li>
<li><p>&#x89E3;&#x58F3;&#x7A0B;&#x5E8F;&#xFF1A;&#x89E3;&#x5BC6;&#x89E3;&#x58F3;&#x6570;&#x636E;&#xFF0C;&#x5E76;&#x8FD0;&#x884C;&#x65F6;&#x901A;&#x8FC7;DexClassLoader&#x52A8;&#x6001;&#x52A0;&#x8F7D;</p>
</li>
<li><p>&#x6E90;&#x7A0B;&#x5E8F;&#xFF1A;&#x9700;&#x8981;&#x52A0;&#x58F3;&#x5904;&#x7406;&#x7684;&#x88AB;&#x4FDD;&#x62A4;&#x4EE3;&#x7801;</p>
</li>
</ul>
<h2 id="&#x52A0;&#x58F3;&#x7684;&#x5229;&#x4E0E;&#x5F0A;"><a href="#&#x52A0;&#x58F3;&#x7684;&#x5229;&#x4E0E;&#x5F0A;" class="headerlink" title="&#x52A0;&#x58F3;&#x7684;&#x5229;&#x4E0E;&#x5F0A;"></a>&#x52A0;&#x58F3;&#x7684;&#x5229;&#x4E0E;&#x5F0A;</h2><h3 id="&#x4F18;&#x52BF;"><a href="#&#x4F18;&#x52BF;" class="headerlink" title="&#x4F18;&#x52BF;"></a>&#x4F18;&#x52BF;</h3><ul>
<li><p>&#x4FDD;&#x62A4;&#x81EA;&#x5DF1;&#x6838;&#x5FC3;&#x4EE3;&#x7801;&#x7B97;&#x6CD5;,&#x63D0;&#x9AD8;&#x7834;&#x89E3;/&#x76D7;&#x7248;/&#x4E8C;&#x6B21;&#x6253;&#x5305;&#x7684;&#x96BE;&#x5EA6;</p>
</li>
<li><p>&#x8FD8;&#x53EF;&#x4EE5;&#x7F13;&#x89E3;&#x4EE3;&#x7801;&#x6CE8;&#x5165;/&#x52A8;&#x6001;&#x8C03;&#x8BD5;/&#x5185;&#x5B58;&#x6CE8;&#x5165;&#x653B;&#x51FB;</p>
</li>
</ul>
<h3 id="&#x52A3;&#x52BF;"><a href="#&#x52A3;&#x52BF;" class="headerlink" title="&#x52A3;&#x52BF;"></a>&#x52A3;&#x52BF;</h3><ul>
<li><p>&#x5F71;&#x54CD;&#x517C;&#x5BB9;&#x6027;</p>
</li>
<li><p>&#x5F71;&#x54CD;&#x7A0B;&#x5E8F;&#x8FD0;&#x884C;&#x6548;&#x7387;</p>
</li>
</ul>
<h2 id="&#x5E38;&#x7528;&#x7684;&#x52A0;&#x58F3;&#x65B9;&#x5F0F;"><a href="#&#x5E38;&#x7528;&#x7684;&#x52A0;&#x58F3;&#x65B9;&#x5F0F;" class="headerlink" title="&#x5E38;&#x7528;&#x7684;&#x52A0;&#x58F3;&#x65B9;&#x5F0F;"></a>&#x5E38;&#x7528;&#x7684;&#x52A0;&#x58F3;&#x65B9;&#x5F0F;</h2><ul>
<li><a href="https://cloud.tencent.com/product/ms?idx=2" target="_blank" rel="noopener">&#x817E;&#x8BAF;&#x4E50;&#x56FA;</a></li>
</ul>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div>谢谢老板，请尽情用红包来蹂躏我吧！！！</div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/uploads/wechatpay.jpg" alt="Tiimor 微信打赏">
        <p>微信打赏</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/uploads/alipay.jpg" alt="Tiimor 支付宝打赏">
        <p>支付宝打赏</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/Android/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>Android</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/混淆/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>混淆</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/反编译/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>反编译</a>
          
            <!-- modify by zhangwei -->
            <!-- 文章底部标签图标 -->
            <a href="/tags/加壳/" rel="tag"><i class="menu-item-icon fa fa-tag fa-fw"></i>加壳</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/Android图表库-MPAndroidChart/" rel="next" title="Android图表库-MPAndroidChart">
                <i class="fa fa-chevron-left"></i> Android图表库-MPAndroidChart
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/Merry-Christmas/" rel="prev" title="Merry Christmas-2017">
                Merry Christmas-2017 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      
        <div id="gitment-container"></div>
      
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/uploads/avatar.jpg" alt="Tiimor">
            
              <p class="site-author-name" itemprop="name">Tiimor</p>
              <p class="site-description motion-element" itemprop="description">安静地做一只攻城狮。</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">41</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">6</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">56</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/VeiZhang" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.weibo.com/tiimor" target="_blank" title="微博">
                      
                        <i class="fa fa-fw fa-weibo"></i>微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://juejin.im/user/589972d0570c3500624fd791" target="_blank" title="掘金">
                      
                        <i class="fa fa-fw fa-anchor"></i>掘金</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://www.jianshu.com/u/93b886580243" target="_blank" title="简书">
                      
                        <i class="fa fa-fw fa-book"></i>简书</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="http://wpa.qq.com/msgrd?v=3&uin=690393541&site=qq&menu=yes" target="_blank" title="QQ">
                      
                        <i class="fa fa-fw fa-qq"></i>QQ</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:tiimor@qq.com" target="_blank" title="邮箱">
                      
                        <i class="fa fa-fw fa-envelope"></i>邮箱</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#反编译"><span class="nav-number">1.</span> <span class="nav-text">反编译</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#反编译工具"><span class="nav-number">1.1.</span> <span class="nav-text">反编译工具</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#未混淆"><span class="nav-number">1.2.</span> <span class="nav-text">未混淆</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#混淆"><span class="nav-number">1.3.</span> <span class="nav-text">混淆</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#混淆-1"><span class="nav-number">2.</span> <span class="nav-text">混淆</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#开启混淆"><span class="nav-number">2.1.</span> <span class="nav-text">开启混淆</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#配置proguard-rules"><span class="nav-number">2.2.</span> <span class="nav-text">配置proguard-rules</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Proguard常用语法"><span class="nav-number">2.3.</span> <span class="nav-text">Proguard常用语法</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#混淆注意"><span class="nav-number">2.4.</span> <span class="nav-text">混淆注意</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#加壳"><span class="nav-number">3.</span> <span class="nav-text">加壳</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#Android-Dex文件加壳原理"><span class="nav-number">3.1.</span> <span class="nav-text">Android Dex文件加壳原理</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#加壳的利与弊"><span class="nav-number">3.2.</span> <span class="nav-text">加壳的利与弊</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#优势"><span class="nav-number">3.2.1.</span> <span class="nav-text">优势</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#劣势"><span class="nav-number">3.2.2.</span> <span class="nav-text">劣势</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#常用的加壳方式"><span class="nav-number">3.3.</span> <span class="nav-text">常用的加壳方式</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2017 &mdash; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Tiimor</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Pisces</a></div>




        
<div class="busuanzi-count">
  <!-- modify by zhangwei -->
  <!-- 修改不蒜子统计脚本 -->
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye"></i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      
    </span>
  
</div>



<script>
  	var _mtac = {};
  	(function() {
  		var mta = document.createElement("script");
  		mta.src = "https://pingjs.qq.com/h5/stats.js?v2.0.4";
  		mta.setAttribute("name", "MTAH5");
  		mta.setAttribute("sid", "500425805");

  		var s = document.getElementsByTagName("script")[0];
  		s.parentNode.insertBefore(mta, s);
  	})();
</script>


  <script type="text/javascript">
    (function() {
      var hm = document.createElement("script");
      hm.src = "//tajs.qq.com/stats?sId=61441764";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
          <span id="scrollpercent"><span>0</span>%</span>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  


  











  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  

  
  
    <script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  







<!-- LOCAL: You can save these files to your site and update links -->
    
        
        <link rel="stylesheet" href="https://aimingoo.github.io/gitmint/style/default.css">
        <script src="https://aimingoo.github.io/gitmint/dist/gitmint.browser.js"></script>
    
<!-- END LOCAL -->

    

    
      <script type="text/javascript">
      function renderGitment(){
        var gitment = new Gitmint({
            <!-- modify by zhangwei -->
            <!-- 修复gitment评论页初始化错误@tiimor -->
            id: '1513685921000', 
            owner: 'VeiZhang',
            repo: 'veizhang.github.io',
            
            lang: "" || navigator.language || navigator.systemLanguage || navigator.userLanguage,
            
            oauth: {
            
            
                client_secret: '9919bc61413a89ea3eb156910d282e3103093e32',
            
                client_id: 'f08924ca58e61d6f51f4'
            }});
        gitment.render('gitment-container');
      }

      
      renderGitment();
      
      </script>
    







  




  
  
  
  <link rel="stylesheet" href="/lib/algolia-instant-search/instantsearch.min.css">

  
  
  <script src="/lib/algolia-instant-search/instantsearch.min.js"></script>
  

  <script src="/js/src/algolia-search.js?v=5.1.4"></script>



  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("7aBs9I9Y3PjoN6ueX5J3AYQW-gzGzoHsz", "kboycyzaPNAYcUW8AkF3edeW");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  

  

  

  

  
  <!-- modify by zhangwei -->
  <!-- 动态时间小人 -->
  <!-- modify by zhangwei -->
<!-- 动态时间小人 -->
<!-- z-index -1 表示在最底层，不能悬浮也不能点击 -->
<!-- z-index auto 可以点击 -->
<!-- z-index 9999 无限大时，总是在最上层，会影响其他悬浮框 -->
<div id="dg" style="z-index: auto; position: fixed ! important; right: 0px; top: 0px;">  
    <table width 100% style="position: absolute; width:260px; right: 0px; top: 0px;">  
		<div>
			<embed wmode="transparent" src="http://cdn.tiimor.cn/images/dynamic_time.swf" quality="high" bgcolor="#ffffff" width="160" height="70" name="honehoneclock" align="middle" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
		</div>
    </table>  
</div>
  
</body>
</html>
